package com.view;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import com.model.Evento;
import com.model.EventoDataModel;
import com.rn.EventoRN;

@ManagedBean
@ViewScoped
public class TableBean implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private List<Evento> eventos;
	private Evento evento;
	private EventoDataModel eventoModel;
	private EventoRN eventoRN = new EventoRN();
	 

	    public TableBean() {
	        eventos = new ArrayList<Evento>();
	        // Populate cars here and thus NOT in the getter method!
	        eventos = eventoRN.listar();
	        
	        eventoModel = new EventoDataModel(eventos);
	    }


		public Evento getEvento() {
			return evento;
		}


		public void setEvento(Evento evento) {
			this.evento = evento;
		}


		public EventoDataModel getEventoModel() {
			return eventoModel;
		}


		public void setEventoModel(EventoDataModel eventoModel) {
			this.eventoModel = eventoModel;
		}
}
